#[derive(Debug)]
enum Shape {
    Rectangle,
    Triangle,
    Circle,
}

#[cfg(test)]
mod tests {
    use crate::match_::Shape;
    #[test]
    fn main() {
        let shape_a = Shape::Rectangle;  // 创建实例
        let ret = match shape_a {        // 匹配实例，并返回结果给ret
            Shape::Rectangle => {
                1
            }
            Shape::Triangle => {
                2
            }
            Shape::Circle => {
                3
            }
        };
        println!("{}", ret);
    }
}